//
//  myTableViewCell.m
//  掌上海印
//
//  Created by 陈德锋 on 16/4/15.
//  Copyright © 2016年 handsome. All rights reserved.
//

#import "myTableViewCell.h"

@implementation myTableViewCell

+ (instancetype)myTableViewCellWithTableView:(UITableView *)tableView
{
    static NSString *ID = @"myTableViewCell";
    myTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    if (!cell) {
        cell = [[myTableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:ID];
    }
    return cell;
}

-(instancetype) initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if(self)
    {
        self.contentView.backgroundColor = [UIColor whiteColor];
//        self.contentView.frame = CGRectMake(0, 20, [[UIScreen mainScreen]bounds].size.width, 70);
        _icon = [[UIImageView alloc] initWithFrame:CGRectZero];
        [self.contentView addSubview:_icon];
        
        _name = [[UILabel alloc] initWithFrame:CGRectZero];
        [self.contentView addSubview:_name];
        
        _depatment = [[UILabel alloc] initWithFrame:CGRectZero];
        [self.contentView addSubview:_depatment];
        
        
        _QRcodeview = [[UIImageView alloc] initWithFrame:CGRectZero];
        [self.contentView addSubview:_QRcodeview];

        
    }
    return self;
}

-(void) layoutSubviews
{
    [super layoutSubviews];
    _icon.frame = CGRectMake(8, 10, 53, 53);
    _icon.image = [UIImage imageNamed:@"001.jpg"];
    
    _name.frame = CGRectMake(71, 15, 60, 15);
    _name.text = @"黄海成";
    
    _depatment.frame =CGRectMake(71, 35, 100, 15);
    _depatment.textColor = [UIColor colorWithRed:187.0/255.0 green:187.0/255.0 blue:187.0/255.0 alpha:1.0];
    _depatment.text = @"产品研发部";
    _depatment.font = [UIFont fontWithName:@"Helvetica" size:13];
    
    _QRcodeview.frame = CGRectMake([[UIScreen mainScreen]bounds].size.width-60, 20, 25, 25);
    _QRcodeview.image = [UIImage imageNamed:@"qrcode"];

}
@end
